<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/jsp/common/commonJs.jsp"%>
</head>
<script>

</script>
<%@ include file="/jsp/head_bus.jsp"%>
<script>
window.onload=function(){
	$("title").html("合同管理");
}
</script>
<!--内容开始-->
<div class="container">
    <div class="row">
        <div class="col-xs-12">
            <h2 class="title text-center"><span>合同管理</span></h2>
        </div>
    </div>
    <div class="c-content">
       <form id="serachForm" method="post"  action="${path}/compact/compactList.do">
         <div class="c-menu c-menu-2"> 
                <span class="input-group">
                    <label class="fl">合同编号：</label>
                    <input type="text" name="contractBianhao" id="contractBianhao" class="form-control  int-110" value="${contract.contractBianhao}" />
                </span>              
                <span class=" input-group input-prepend">
                    <label class="fl">&nbsp;&nbsp;&nbsp;&nbsp;签署日期：</label>
                    <input type="text" name="startDate" id="start_date1" class="Wdate int-110" onClick="WdatePicker({dateFmt:'MM/dd/yyyy'})" value="${startDate}" placeholder="请选择日期"/>
                    <i class="fl">--</i>
                    <input type="text" name="endDate" id="end_date1" class="Wdate int-110 ml101" onClick="WdatePicker({dateFmt:'MM/dd/yyyy'})" value="${endDate}" placeholder="请选择日期"/>
                </span>                  
               <%-- <span class="c-menu-r">
                    <label class="fl">订单状态：</label>
                    <select name="status" id="status" class="form-control int-110">
                        <option value="5" <c:if test="${contract.status==5}">selected</c:if> >全部</option>
                        <option value="0" <c:if test="${contract.status==0}">selected</c:if> >待生效</option>
                        <option value="1" <c:if test="${contract.status==1}">selected</c:if> >已生效</option>
                        <option value="2" <c:if test="${contract.status==2}">selected</c:if> >已过期</option>
                    </select>       
                </span> --%>
                <button type="submit" class="submit btn btn-100">查询</button>   
            </div>
        </form>
        <div class="c-data mb70">
            <table>	
                <thead>
                    <tr >
                        <th width="20%">合同编号</th>
                        <th width="20%">签署时间</th>
                        <th width="15%">合同状态</th>
                        <th width="25%">操作</th>
                    </tr>
                </thead>
                <tbody>
                     <c:forEach items="${page.list}" var="compact">
                    <tr>
                        <td>${compact.contractBianhao}</td>
                        <td><fmt:formatDate value="${compact.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td>
                            <c:if test="${compact.status==0}">
                           		待生效
                            </c:if>
                            <c:if test="${compact.status==1}">
                            	已生效
                            </c:if>
                            <c:if test="${compact.status==2}">
                            	已过期
                            </c:if>
                            </td>
                            <td>
                            <a href="${path}/compact/downloadCompact.do?id=${compact.id}" target="_blank" class="btn btn-w  btn-t" >下载</a>
                            <a href="javascript:downView('${compact.contractBianhao}')" target="_blank" class="btn btn-w  btn-t" >查看</a>
                            </td>
                        </td>
                    </tr>
                    </c:forEach>
                </tbody>
            </table>
            <center>
                 <c:forEach items="${page.pageView}" var="page">
		  			${page}
		  		</c:forEach>
            </center> 
        </div>  
    </div>  
</div>
<!-- 查看合同-->
<div class="modal fade" id="modal-9">
    <div class="modal-dialog modal-870">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>查看</span></h4>
           </div>
           <div class="modal-body">
                <div class="pact">
                </div>
           </div>
        </div>
    </div>
</div>
<script>
	function downView(id){
		$.ajax({
	       cache: true,
	       type: "POST",
	       url:"${path}/compact/compactdetail.do",
	       dataType : 'json',
	       data:{contractBianhao:id},
	       async: false,
	       success: function(data)
	       {
	       		if(data.status){
	       			$(".pact").html(data.info);
	       			$('#modal-9').modal('show');
	       		}else{
	       			alert(data.info);
	       			return;
	       		}
	       }
	 });
	}
</script>

	
</html>


<%@ include file="/jsp/foot_bus.jsp"%>